
package com.fis.mca.persistence;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.fis.mca.util.StringUtil;


/**
 * <p>Java class for chargeBand complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="chargeBand">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="bandId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="chargeBandVersions" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="tariffPlans" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "chargeBand", propOrder = {
    "bandId",
    "chargeBandVersions",
    "code",
    "description",
    "name",
    "status",
    "tariffPlans"
})
public class ChargeBand implements Comparable<ChargeBand>{

    protected int bandId;
    @XmlElement(nillable = true)
    protected List<Object> chargeBandVersions;
    protected String code;
    protected String description;
    protected String name;
    protected String status;
    @XmlElement(nillable = true)
    protected List<Object> tariffPlans;

    /**
     * Gets the value of the bandId property.
     * 
     */
    public int getBandId() {
        return bandId;
    }

    /**
     * Sets the value of the bandId property.
     * 
     */
    public void setBandId(int value) {
        this.bandId = value;
    }

    /**
     * Gets the value of the chargeBandVersions property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the chargeBandVersions property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getChargeBandVersions().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getChargeBandVersions() {
        if (chargeBandVersions == null) {
            chargeBandVersions = new ArrayList<Object>();
        }
        return this.chargeBandVersions;
    }

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCode(String value) {
        this.code = value.toUpperCase().trim();
    }

    /**
     * Gets the value of the description property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDescription(String value) {
    	this.description = (value == null) ? value : value.trim();
    }

    /**
     * Gets the value of the name property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
        this.name = value.trim();
    }

    /**
     * Gets the value of the status property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the value of the status property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setStatus(String value) {
        this.status = value;
    }

    /**
     * Gets the value of the tariffPlans property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the tariffPlans property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getTariffPlans().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getTariffPlans() {
        if (tariffPlans == null) {
            tariffPlans = new ArrayList<Object>();
        }
        return this.tariffPlans;
    }
    
    @Override
    public String toString()
    {
    	return this.name;
    }
    
    public boolean equals(Object obj){
    	if(this==obj){
    		return true;
    	}
    	if ((obj==null)||(obj.getClass()!=this.getClass())){
    		return false;
    	}
    	ChargeBand chargeBand=(ChargeBand) obj;
    	return bandId==chargeBand.getBandId();
    }

	@Override
	public int compareTo(ChargeBand o)
	{
		String o1 = this.getName();
		String o2 = o.getName();
		return StringUtil.compareVietnameseString(o1, o2);
	}

}
